<?php

if(!isset($_GET["id"]))
	die;

# get connection with mysql
$dblink = @mysql_connect("localhost","sm",""); $database = "sm";

if (!$dblink) {
    die('Could not connect: ' . mysql_error());
}
# select and open database
mysql_select_db($database,$dblink);

$DataArray = Array();

$result = mysql_query('SELECT * FROM `sm_natives` WHERE `owner`=(SELECT `owner` FROM `sm_natives` WHERE `name`=\'' . mysql_escape_string ( $_GET["id"] ) .'\')');

if( mysql_num_rows( $result ) > 0 ) {

	$TotalData = Array();
	
	while( $row = mysql_fetch_assoc( $result ) ){
	
		$row["input"] = json_decode( $row["input"] );
		
		$TotalData[] = $row;
	}
	
	echo json_encode( $TotalData );	
	
} else
	echo "404";


?>